package common.packets;

import common.interfaces.IClient;

/**
 * Handles sending notifications of leaving users to logged in clients
 */
public class NotificationRemovePacket extends Packet {

	public static final String PREFIX = "notification_remove";
	
	private String clientName;
	
	public NotificationRemovePacket(String client) {
		clientName = client;
	}	
	
	public NotificationRemovePacket(IClient disconnected) {
		clientName = disconnected.getUserName();
	}

	@Override
	public byte[] serialize() {
		return (PREFIX + Packet.DELIMITER + clientName + Packet.NEW_LINE).getBytes();		
	}

	@Override
	public String toString() {
		return PREFIX;
	}

	public String getClientName() {
		return clientName;
	}

}
